#pragma once
#include"public_struct.h"
string reverseVowels(string s) {
	int i = 0, j = s.size() - 1;
	unordered_set<char> u_set{ 'a','e','i','o','u','A','E','I','O','U' };
	while (i < j) {
		if (u_set.find(s[i]) != u_set.end() && u_set.find(s[j]) != u_set.end()) {
			swap(s[i], s[j]);
			i++;
			j--;
		}
		else if (u_set.find(s[i]) == u_set.end()) {
			i++;
		}
		else if (u_set.find(s[j]) == u_set.end()) {
			j--;
		}
	}
	return s;
}

string reverseVowels(string s) {
	int i = 0, j = s.size() - 1;
	unordered_map<char, int> u_map{ {'a',1},{'e',1},{'i',1},{'o',1},{'u',1},{'A',1},{'E',1},{'I',1},{'O',1},{'U',1} };
	while (i < j) {
		if (u_map.count(s[i]) && u_map.count(s[j])) {
			swap(s[i], s[j]);
			i++;
			j--;
		}
		else if (!u_map.count(s[i])) {
			i++;
		}
		else if (!u_map.count(s[j])) {
			j--;
		}
	}
	return s;
}

string reverseVowels(string s) {
	int i = 0, j = s.size() - 1;
	unordered_map<char, int> u_map{ {'a',1},{'e',1},{'i',1},{'o',1},{'u',1},{'A',1},{'E',1},{'I',1},{'O',1},{'U',1} };
	while (i < j) {
		if (!u_map.count(s[i])) {
			i++;
			continue;
		}
		if (!u_map.count(s[j])) {
			j--;
			continue;
		}
		swap(s[i], s[j]);
		i++;
		j--;
	}
	return s;
}